import request from '../util/axios'
import qs from 'qs'

/*
* 登录请求
* */
export function getLogin (params) {
  return request({
    url: '/user/login',
    method: 'post',
    headers:{ 
      'content-type':'application/x-www-form-urlencoded'
    },
    data: qs.stringify(params),
  })
}

/*
* 获取登录用户
* */
export function getUserInfo(){
  return request({
    url: '/user/getUserInfo',
    method: 'get'
  })
}
/*
* 验证邮箱密码
* */
export function validateCode(formData,code){
  let data={
    userId:formData.username,
    password:formData.checkPass,
    code:code
  }
  return request({
    url: '/auth/validateCode',
    method:'post',
    headers:{
      'content-type':'application/x-www-form-urlencoded'
    },
    data: qs.stringify(data)
  })
}

